package com.kakarote.examine.constant;

import com.kakarote.core.common.enums.SystemCodeEnum;
import com.kakarote.core.exception.CrmException;

import java.util.Objects;

public enum ReportSubFlagEnum {

    //我提交的
    SUBMIT_SUM(1),
    //我审批的
    AUDIT_SUM(2),
    //5小时内审批的
    AUDIT_5(3),
    //5-12小时内审批的
    AUDIT_5_12(4),
    //12-24小时内审批的
    AUDIT_12_24(5),
    //超过24小时审批的
    AUDIT_24(6),
    ;

    private ReportSubFlagEnum(Integer type) {
        this.type = type;
    }

    private Integer type;

    public Integer getType() {
        return type;
    }

    public static ReportSubFlagEnum valueOf(Integer type) {
        for (ReportSubFlagEnum handleTypeEnum : values()) {
            if (Objects.equals(type, handleTypeEnum.getType())) {
                return handleTypeEnum;
            }
        }
        throw new CrmException(SystemCodeEnum.SYSTEM_NO_VALID);
    }

}
